package ch.bfh.mobicomp.soda2.magnetometer;

import ch.bfh.ballon.magnetometer.R;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;

public class MainActivity extends Activity {

	public static final String LOG_TAG = "ballon";
	private Intent measureControlIntent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		measureControlIntent = new Intent(this, ControlUnitService.class);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		
		startService(measureControlIntent);
		Log.d(MainActivity.LOG_TAG, "onResume");
	}

	@Override
	protected void onPause() {
		super.onPause();
		
		stopService(measureControlIntent);
		Log.d(MainActivity.LOG_TAG, "onPause");
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}


}
